Add a css style test for adjacent states
authorMatthias Clasen <mclasen@redhat.com>
Sun, 10 Jan 2016 19:50:24 +0000 (14:50 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 10 Jan 2016 19:51:36 +0000 (14:51 -0500)
This test checks that the selector E:state + F works as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=722727

testsuite/css/style/Makefile.am
testsuite/css/style/adjacent-states.css [new file with mode: 0644]
testsuite/css/style/adjacent-states.nodes [new file with mode: 0644]
testsuite/css/style/adjacent-states.ui [new file with mode: 0644]

index 04972af2e3194ddeb5d4ec2a0bfe430db919b1d5..a89eb375aa8dd20a36f28eb64749cbc7e422f117 100644 (file)
@@ -29,11 +29,12 @@ test_css_style_SOURCES = \
        $(NULL)
 
 test_data = \
-        currentcolor.ui currentcolor.css        currentcolor.nodes      \
-        gradient.ui     gradient.css            gradient.nodes          \
-        inherit.ui      inherit.css             inherit.nodes           \
-       label.ui        label.css               label.nodes             \
-       nth-child.ui    nth-child.css           nth-child.nodes         \
+       adjacent-states.ui      adjacent-states.css     adjacent-states.nodes   \
+        currentcolor.ui        currentcolor.css        currentcolor.nodes      \
+        gradient.ui                    gradient.css            gradient.nodes          \
+        inherit.ui             inherit.css             inherit.nodes           \
+       label.ui                label.css               label.nodes             \
+       nth-child.ui            nth-child.css           nth-child.nodes         \
        $(NULL)
 
 BUILT_SOURCES = resources.c
diff --git a/testsuite/css/style/adjacent-states.css b/testsuite/css/style/adjacent-states.css
new file mode 100644 (file)
index 0000000..f29150b
--- /dev/null
@@ -0,0 +1,7 @@
+checkbutton:checked + label {
+  color: red;
+}
+
+checkbutton + label {
+  color: blue;
+}
diff --git a/testsuite/css/style/adjacent-states.nodes b/testsuite/css/style/adjacent-states.nodes
new file mode 100644 (file)
index 0000000..25c8e17
--- /dev/null
@@ -0,0 +1,13 @@
+[window.background:dir(ltr)]
+  decoration:dir(ltr)
+  box.horizontal:dir(ltr)
+    box.horizontal:dir(ltr)
+      checkbutton:dir(ltr):checked
+        check:dir(ltr):checked
+      label#label1:dir(ltr)
+        color: rgb(255,0,0); /* adjacent-states.css:2:12 */
+    box.horizontal:dir(ltr)
+      checkbutton:dir(ltr)
+        check:dir(ltr)
+      label#label2:dir(ltr)
+        color: rgb(0,0,255); /* adjacent-states.css:6:13 */
diff --git a/testsuite/css/style/adjacent-states.ui b/testsuite/css/style/adjacent-states.ui
new file mode 100644 (file)
index 0000000..bf2a755
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkCheckButton">
+                <property name="visible">True</property>
+                <property name="active">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="name">label1</property>
+                <property name="label" translatable="yes">Hello World!</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkCheckButton">
+                <property name="visible">True</property>
+                <property name="active">False</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="name">label2</property>
+                <property name="label" translatable="yes">Hello World!</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>